package com.woniuxy.sale.controller;

import com.woniuxy.commons.annotations.RequirePermission;
import com.woniuxy.commons.result.Result;
import com.woniuxy.commons.entity.sale.vo.sale.ProductVo;
import com.woniuxy.sale.service.ProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO: 产品控制器
 * <P> Date: 2022/4/20:14:02
 * <P> Description:
 */
@RestController
@RequestMapping("/sale/product")
@Api(tags = "产品")
public class ProductController {

    @Resource
    private ProductService productService;

    @RequirePermission("addPackingList")
    @ApiOperation(value = "查找商品 分页 或使用条码查找")
    @PostMapping("/findProductByPage/{currentPage}/{limit}")
    public Result findProductByPage(@PathVariable(value = "currentPage") Integer currentPage,
                                    @PathVariable(value = "limit") Integer limit,
                                    @RequestBody ProductVo productVo) {
        return  productService.findProductByPage(currentPage, limit,productVo);

    }
}
